cmake_minimum_required(VERSION 3.1.0)

project(carla_boost_gui VERSION 1.0.0 LANGUAGES CXX)

# Default to C99
if(NOT CMAKE_C_STANDARD)
  set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# 变量设置
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
# set(glog_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../third-parts/glog-build/lib/cmake/glog)

if(CMAKE_VERSION VERSION_LESS "3.7.0")
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../third-parts/libcarla-build/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../third-parts/libcarla-build/include/system)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../third-parts/glog-build)

find_package(Qt5 COMPONENTS Widgets REQUIRED)
# find_package(glog 0.6.0 REQUIRED)

add_executable(${PROJECT_NAME}
    src/main.cpp
    src/MainWindow.cpp
)

target_link_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../third-parts/libcarla-build/lib)
target_link_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../third-parts/glog-build/lib)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} -lcarla_client -lrpc -lboost_filesystem -lpng -ltiff -ljpeg -lRecast -lDetour -lDetourCrowd -lpthread)
target_link_libraries(${PROJECT_NAME} -lglog)

# 安装
install(TARGETS ${PROJECT_NAME} DESTINATION bin/${PROJECT_NAME})